import { makeAutoObservable } from 'mobx'
import { getToken } from '@/utils'
import jwtDecode from 'jwt-decode'
class UserStore {
  userInfo = {}
  constructor() {
    makeAutoObservable(this)
  }
  getUserInfo = () => {
    // 调用接口获取数据
    const token = getToken()
    const userInfo = jwtDecode(token)
    this.userInfo = userInfo
    console.log(userInfo)
  }
}

export default UserStore